/*!
  @file signal.cpp
  @brief 
  @author Kyohei Otsu <kyon@ac.jaxa.jp>
  @date Apirl, 2013
*/

#include <signal.h>
#include <time.h>

#include "core/io.h"
#include "core/signal.h"

namespace mrover
{

bool quit = false;

void handleSignal(int signum) 
{ 
  INFO("Signal received");
  quit = true;
}

void init()
{
  signal(SIGINT, handleSignal);
}

void spin()
{
  while (true) {
    if (quit) break;
  }
}

void spinOnce()
{
  sleep(0.1);
}


} // end of namespace
